
class LargeimagehostPlugin:
	def __init__(self):
		# put all the links this plugins supports here - it will be used to filter supported URLs
		self.supported_sites = ['largeimagehost.com']
		# the URLs we support
		self.supported_urls = self.supported_sites
		# the cookies we want to block
		self.cookies_to_block = []
		# whether we support pause/resume
		self.supports_resume = False
		# maximum number of concurrent downloads
		self.max_concurrent = 1
		# parameter names we require
		self.param_names = []
		# parameter values
		self.param_vals = {}
		self.name = self.supported_sites[0]

	def get(self, url):
		#http://s2.largeimagehost.com/displayimage.php?img=ERO+08_00.jpg&loc=eXtrchc&skey=june16
		"""Get the file from the url"""
		url = get_img_url(url, '/displayimage.php?img=')
		if not url:
			raise CantDownload("Can't find download URL")

		local_file = get_valid_name(find_attr(url, 'img'))
		download_file_with_retries(local_file, url)
		config.report.report_finish(local_file)

	def url_matches(self, url):
		"""Check whether we support this URL"""
		if 'largeimagehost.com/TN/' in url:
			return False
		for l in self.supported_urls:
			if l in url:
				return True
		return False

	def version(self):
		"""Return plugin version - when interface changes, the version changes"""
		return 2

modules = [LargeimagehostPlugin()]
